import {Random} from "mockjs"; // 导出随机函数

function login(req) {
    // req是一个请求对象，包含: url，type和body属性
    console.log(req)
    return {
        code: 200,
        data: {
            username: Random.cname(),
            token: Random.guid(),
            message: "Login successfully."
        }
    };
}

function logout(req) {
    console.log(req)
    return {
        code: 200,
        data: {
            message: "Logout successfully."
        }
    };
}

export default {
    login,
    logout
};
